#!/bin/bash

# arg1 is the connection string

YELLOW="\033[38;5;226m"
NOCOLOR="\033[39;0m"
ECHO_E="echo $(echo -e foo | perl -ne '/^foo/ and print "-e"')"
TEST_N=1

function runtest () {
  echo
  echo
  ${ECHO_E} "${YELLOW}Running test #$TEST_N: '$*'${NOCOLOR}"
  node "$@"
  TEST_N=$((TEST_N + 1))
}

runtest zk_test_a_get_children.js $1
runtest zk_test_buffer.js $1
runtest zk_test_chain.js 2 $1
runtest zk_test_create.js 10 2 $1
runtest zk_test_mkdirp.js $1
runtest zk_test_utf8.js $1
runtest zk_test_watcher.js 2 $1
runtest zk_test_watcher_promise.js $1
runtest zk_test_watcher_session.js 2 $1
runtest zk_test_end_session.js $1
